#pragma once

#include "gpio.h"
#include "stdint.h"
void i2c_start();
void i2c_stop();
uint8_t i2c_wait_ack();
void i2c_ack();
void i2c_nack();
void i2c_write_byte(uint8_t data);
uint8_t i2c_get_byte(uint8_t ack);

void i2c_gpio_init();
void i2c_delay_us(uint16_t us);
void AT24CXX_Write(uint16_t WriteAddr, uint8_t *pBuffer, uint16_t NumToWrite);
void AT24CXX_Read(uint16_t ReadAddr, uint8_t *pBuffer, uint16_t NumToRead);
void i2c_24c02_write_mem_8bit(uint16_t memaddr, uint8_t buf);

void i2c_24c02_write_mem_8bit_256(uint16_t memaddr, uint8_t buf);

uint8_t i2c_24c02_read_mem(uint16_t memaddr, uint8_t *buf, uint8_t len);

void SDA(uint8_t stat);

void SCL(uint8_t stat);

uint8_t i2c_wait_ack();
